package com.itheima.demo04;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static java.util.concurrent.Executors.*;

/**
 * @author Zhang_Han
 * @version 1.0
 * @date 2020/7/13 17:05
 */
public class Demo_001 {
    public static void main(String[] args) {
        //ExecutorService executorService = Executors.newCachedThreadPool();
        ExecutorService executorService = newCachedThreadPool();
        executorService.submit(() -> {
            System.out.println(Thread.currentThread().getName() + "执行了");
        });

        executorService.submit(() -> {
            System.out.println(Thread.currentThread().getName() + "执行了");
        });
        executorService.shutdown();
    }
}
